#pragma once

namespace cufutils
{
    //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx atomic min max
    __device__ double atomicMin_double(double* address, double val);

    __device__ double atomicMax_double(double* address, double val);

    //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

    // 自定义 double 类型的原子最小值操作
    __device__ double AtomicMinDouble(double* address, double val);

    // 自定义 double 类型的原子最大值操作
    __device__ double AtomicMaxDouble(double* address, double val);

}  // namespace cufutil

//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
__global__ void CuReduceMinMax(int len, double* d_x, double* d_min, double* d_max);
